package chat.whiteboard.draw.state;

import java.awt.Color;

import chat.whiteboard.WhiteBoardController;


public class DrawingStateManager {
	private WhiteBoardController controller = null;

	private RectangleState 	rectState;
	private CircleState 	circleState;
	private ArrowState 		arrowState;
	private LineState 		lineState;
	private DrawingState currentState;
	private Color			color;
	public DrawingStateManager(WhiteBoardController controller){
		this.controller = controller;
		
		rectState 	= new RectangleState(controller);
		circleState = new CircleState(controller);
		arrowState 	= new ArrowState(controller);
		lineState 	= new LineState(controller);
		currentState= rectState; 
	}
	public void setColor(Color color){
		this.color = color;
		rectState.setColor(color);
		circleState.setColor(color);
		arrowState.setColor(color);
		lineState.setColor(color);
	}
	public void setRectangleState(){
		currentState = rectState;
	}
	public void setCircleState(){
		currentState = circleState;
	}
	public void setArrowState(){
		currentState = arrowState;
	}
	public void setLineState(){
		currentState = lineState;
	}
	public void mouseDown(int x, int y){
		currentState.mouseDown(x, y);
	}
	public void mouseUp(int x, int y){
		currentState.mouseUp(x, y);
	}
}
